import request from '@/config/axios'
import type { Dayjs } from 'dayjs'

/** 路线配置信息 */
export interface RobotRouteConfig {
  id: number // 编号
  routeId?: number // 路线ID
  siteName?: string // 地点名称
  fileUrls: string // 图片
  description: string // 讲解
  sort?: number // 排序
  status?: number // 状态
}

// 路线配置 API
export const RobotRouteConfigApi = {
  // 查询路线配置分页
  getRobotRouteConfigPage: async (params: any) => {
    return await request.get({ url: `/school/robot-route-config/page`, params })
  },

  // 查询路线配置详情
  getRobotRouteConfig: async (id: number) => {
    return await request.get({ url: `/school/robot-route-config/get?id=` + id })
  },

  // 新增路线配置
  createRobotRouteConfig: async (data: RobotRouteConfig) => {
    return await request.post({ url: `/school/robot-route-config/create`, data })
  },

  // 修改路线配置
  updateRobotRouteConfig: async (data: RobotRouteConfig) => {
    return await request.put({ url: `/school/robot-route-config/update`, data })
  },

  // 删除路线配置
  deleteRobotRouteConfig: async (id: number) => {
    return await request.delete({ url: `/school/robot-route-config/delete?id=` + id })
  },

  /** 批量删除路线配置 */
  deleteRobotRouteConfigList: async (ids: number[]) => {
    return await request.delete({
      url: `/school/robot-route-config/delete-list?ids=${ids.join(',')}`
    })
  },

  // 导出路线配置 Excel
  exportRobotRouteConfig: async (params) => {
    return await request.download({ url: `/school/robot-route-config/export-excel`, params })
  }
}
